
from ai.consts import PLATFORM_QIAN_FAN, PLATFORM_KIMI, PLATFORM_HUO_SHAN, PLATFORM_HUN_YUAN, PLATFORM_ZHI_PU, PLATFORM_XING_HUO, PLATFORM_BAI_LIAN

from ai.model.qianfan import get_qianfan_result
from ai.model.kimi import get_kimi_result
from ai.model.huoshan import get_huoshan_result
from ai.model.hunyuan import get_hunyuan_result
from ai.model.zhipu import get_zhipu_result
from ai.model.xinghuo import get_xinghuo_result
from ai.model.bailian import get_bailian_result

def get_ai_result(data, ai_info):
    tag_name = ai_info['tag_name']
    model_name = ai_info['model_name']
    
    # 根据不同的平台和模型进行不同的模型调用
    if tag_name == PLATFORM_QIAN_FAN:
        result = get_qianfan_result(data, model_name)
    elif tag_name == PLATFORM_KIMI:
        result = get_kimi_result(data, model_name)
    elif tag_name == PLATFORM_HUO_SHAN:
        result = get_huoshan_result(data, model_name)
    elif tag_name == PLATFORM_HUN_YUAN:
        result = get_hunyuan_result(data, model_name)
    elif tag_name == PLATFORM_ZHI_PU:
        result = get_zhipu_result(data, model_name)
    elif tag_name == PLATFORM_XING_HUO:
        result = get_xinghuo_result(data, model_name)
    elif tag_name == PLATFORM_BAI_LIAN:
        result = get_bailian_result(data, model_name)
    
    # 做一层检验
    prove_list = ["zombie", "fans_score", "content_score", "personal_score", "normal_behaviour_score", "reason"]
    if not result:
        return None
    for prove in prove_list:
        if prove not in result.keys():
            return None  
    return result
